/*
 * @Description: 
 * @Author: handongliang dongliang.han@12301.cn
 * @Date: 2023-09-08 16:25:09
 * @LastEditTime: 2023-12-03 10:54:46
 */
import './index.less'

const TypeCount: React.FC<{
    title?: string,
    value?: string | number,
    unit?: string,
    color?: string,
    size?: 'large' | 'normal' | 'small',
    style?: any,
    valueStyle?: any,
    textStyle?: any,
    className?: string,
    formatter?: any
    top?: true
}> = (props) => {
    const { title, value, unit, color = '#0AEBFF', size = 'normal', style, valueStyle, textStyle, formatter, className = '',top=false } = props

    return (
        <>
           {top&&<span className='type-count--name' style={{ ...textStyle }}>{title}</span>}
           <div className={`type-count type-count--${size} ${className}`} style={style}>
            {!top&&<span className='type-count--name' style={{ ...textStyle }}>{title}</span>}
            <span className='type-count--value' style={{ color: color, ...valueStyle }}>
                {formatter ? formatter(value) : value}</span>
            {unit ? <span className='type-count--unit' >{unit}</span> : null}
        </div>
        </>
       
    )
}
export default TypeCount